//
//  AddFriendViewController.m
//  环信即时通讯
//
//  Created by 夏阳光 on 16/4/19.
//  Copyright © 2016年 夏阳光. All rights reserved.
//

#import "AddFriendViewController.h"
#import <HyphenateFullSDK/EMSDKFull.h>

@interface AddFriendViewController ()
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;

@end

@implementation AddFriendViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (IBAction)addFriendAction:(UIButton *)sender {
    
    //发送添加好友申请
    EMError *error = [[EMClient sharedClient].contactManager addContact:self.nameTextField.text message:@"我想加您为好友"];
    if (!error) {
        NSLog(@"添加成功");
        
        [self.navigationController popViewControllerAnimated:YES];
    }else{
        NSLog(@"添加好友失败－－－－－－－%@",error);
    }
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
